interface student {
    "name": string,
    "gender": string,
    "age": number,
    // 可选属性，使用过程中可以出现，也可以不出现
    "email"?: string
}

let stu1:student =  {
    "name":"zhangsan",
    "gender":"M",
    "age":18,
    "email":"zhangsan@126.com"
}

let stu2:student =  {
    "name":"lisi",
    "gender":"W",
    "age":18,
}

console.log(stu1);
stu1.age = 20
console.log(stu1);


interface stud {
    "name": string,
    readonly "gender": string,
    "age": number,
    // 可选属性，使用过程中可以出现，也可以不出现
    "email"?: string
}

let stu3: stud = {
    "name":"王五",
    "gender":"W",
    "age":18,
}

// 不能修改只读属性的值
// stu3.gender = "M"


interface Animal {
    "name":string
}


interface Cat extends Animal {
 "name":string,
 "hobbies":[],
}

// Animal 范围大于 Cat.
// Cat 是 Animal 的子接口



